package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.product.model.BaseAttrInfo;
import com.atguigu.gmall.product.model.SkuAttrValue;
import com.atguigu.gmall.product.mapper.SkuAttrValueMapper;
import com.atguigu.gmall.product.model.SkuImage;
import com.atguigu.gmall.product.service.SkuAttrValueService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * sku平台属性值关联表 业务实现类
 *
 * @author muzhuo
 * @since 2023-07-26
 */
@Service
public class SkuAttrValueServiceImpl extends ServiceImpl<SkuAttrValueMapper, SkuAttrValue> implements SkuAttrValueService {

    @Override
    public List<SkuAttrValue> getListBySkuId(Long skuId) {

        LambdaQueryWrapper<SkuAttrValue> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SkuAttrValue::getSkuId, skuId);
        return this.list(queryWrapper);
    }

    @Override
    public List<BaseAttrInfo> getAttrList(Long skuId) {

       return baseMapper.getAttrList(skuId);

    }
}
